package com.training.entity;

import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class Course {

    private Long id;
    private Long teaId;
    private String couName;
    private String couIntroduction;
    private String couPic;
    private Integer couTypeId;
    private Integer couParTypeId;

    // 使用 BigDecimal 保证价格精度
    private BigDecimal couPrice = BigDecimal.ZERO;

    // --- 核心修正：为所有计数字段设置默认值 0，防止数据库插入时报 "cannot be null" 错误 ---
    private Integer couCataNum = 0;
    private Long couCollNum = 0L;
    private Long couLikeNum = 0L;
    private Long couShareNum = 0L;
    private Long clicks = 0L;
    private Long purchase = 0L;
    private Integer deleted = 0;
    private Float couScore = 0.0f;

    // 使用 LocalDateTime 替代旧的 Timestamp
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    // 非数据库字段，用于显示
    private String teacherName;
}